//
//
// Adventure screen handler for the Treasure Chest
//
// L. Dean Gibson II  2/16/01
//
//

#ifndef ADV_TREASURE_CHEST_H_INCLUDED
#define ADV_TREASURE_CHEST_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "artifact_type.h"
#include "stationary_adventure_object.h"

class t_player;
// -------------------------------------------------------
// artifact as it appears on the adventure map
// -------------------------------------------------------
class t_adv_treasure_chest : public t_stationary_adventure_object
{
public:
	t_adv_treasure_chest( std::string const& model_name );
	virtual void		activate_trigger( t_army* army, t_adv_map_point const& point, 
		                                   t_direction direction, t_adventure_frame* frame );
	virtual float		ai_value( t_adventure_ai const& ai, t_creature_array const& army, int move_cost ) const;
	int                 get_gold();

protected:
	void         give_artifact( t_army* army, t_level_map_point_2d point, 
		                        t_direction direction, t_adventure_frame* frame);
	void		 give_gold( t_player* player, t_level_map_point_2d point );
	virtual void initialize( t_adventure_map& map );
	virtual bool read( std::streambuf&						stream, 
				       t_qualified_adv_object_type const&	type,
					   int									version );
	virtual bool write( std::streambuf& stream ) const;
private:
	int				m_chest_gold;
	t_artifact_type m_artifact;
};

inline int t_adv_treasure_chest::get_gold()  
{
	return m_chest_gold; 
}

#endif // ADV_TREASURE_CHEST_H_INCLUDED